package configs

import (
	"gopkg.in/yaml.v2"
	"io/ioutil"
	"log"
)

var confDir string

func SetConfDir(dir string){
	confDir = dir
}

func GetConfig(path string) (map[string]map[string]string){
	confStr,err := ioutil.ReadFile(confDir+path)
	if err != nil{
		log.Fatalln(err)
	}
	conf := make(map[string]map[string]string)
	err = yaml.Unmarshal(confStr,&conf)
	if err != nil {
		log.Fatalln(err)
	}
	return conf
}